<template>
  <div class="base-echart">
    <!-- <div ref="echartDivRef" :style="{ width: width, height: height }"></div> -->
    <div ref="echartDivRef" :style="{ width: '100%', height: '270px' }"></div>
  </div>
</template>

<script setup>
import { ref, onMounted, watchEffect } from 'vue'
import useEchart from './useEchart'

const props = defineProps({
  options: Object
})

const echartDivRef = ref()

onMounted(() => {
  const { setOptions } = useEchart(echartDivRef.value)

  watchEffect(() => {
    setOptions(props.options)
  })
})
</script>

<style lang="less" scoped></style>
